#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QApplication>
#include <QLineEdit>
#include <QPainter>
#include <QTextCursor>
#include <QKeyEvent>

#include "phoneloginwidget.h"
#include "toast.h"
#include "verifycodewidget.h"
#include "model/datacenter.h"
#include "customlineedit.h"

using namespace model;




class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);

    void switchMode();

    void clickSubmitBtn();
    void userLoginDone(bool ok, const QString& reason);
    void userRegisterDone(bool ok, const QString& reason);

private:
    bool isLoginMode = true;
    CustomLineEdit* usernameEdit;
    CustomLineEdit* passwordEdit;
    CustomLineEdit* verifyCodeEdit;
    VerifyCodeWidget* verifyCodeWidget;
    QPushButton* submitBtn;
    QPushButton* phoneModeBtn;
    QPushButton* switchModeBtn;
signals:
};




#endif // LOGINWIDGET_H
